사이트 내 전체검색
웹앱 개발시 네이티브앱처럼 보이게 화면 touchmove해도 브라우져 움직이지 않게 하는 방법이 먼가요? 트윗에서 언급하신적 있으신데 도저히 못찼겠어요 ㅠㅠ
로빈아빠
https://cmd.kr/iphone/52 URL이 복사되었습니다.

본문

방금 테스트 해봤는데요~
<script>
        function scrollLockOnoff(){
            if(document.ontouchmove){
                document.ontouchmove = "";
            }
            else{
                 document.ontouchmove = function(e){
                       e.preventDefault();
                       return false;
                   }
            }
        }
</script>
<input type="button" value="scrollLockOnoff" onclick="scrollLockOnoff();"></input>
요렇게 하니까 되네요~
 
1 개월 전 by jeoim

document.ontouchmove = function(){
    return false;
}

이거 추가하면 안되나요? 저도 테스트 해봐야겟네요

댓글목록

등록된 댓글이 없습니다.

Search

Copyright © Cmd 명령어 18.118.227.69